# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         test02
# Description:
# Author:       98745
# Date:         2019/4/3
#-------------------------------------------------------------------------------
import re
s='\d{,3}-[a-z|A-Z]{,2}'
list=['123-abc','432-xyz','678-agh']
for i in list:
    r=re.search(s,i)
    if r is not None:
        print(r.group())
    else:
        print('{}不匹配'.format(i))